package com.pingan.agentbank.aaos.testme;

import com.pingan.agentbank.aaos.dao.ApproFileDao;
import com.pingan.agentbank.aaos.service.ApproFileDaoService;

import com.pingan.vframe.db.DBTask;
import com.pingan.vframe.lang.Inject;


public class TestTask extends DBTask implements Cloneable{


    @Inject
    ApproFileDao  approFileDao;

    @Inject
    ApproFileDaoService approFileDaoService;



    @Override
    protected void execute() throws InterruptedException {

        //JaDateTime对应DateTime测试，JaDateTime使用当前时间戳构造方法，能不能插入成功
        /*FileInfo fileInfo = new FileInfo();
        fileInfo.setFile_name("beijing");
        //fileInfo.setStart_time(JaDateTime.valueOf(System.currentTimeMillis()));
        fileInfo.setStart_time(JaDateTime.valueOf("20120611 111111"));
        fileDaoService.saveOneFileInfo(fileInfo);*/























        //ApproFileInfo approFileInfo = new ApproFileInfo();


        /*approFileInfo.setBank("jiangyin");
        JaDateTime jaDateTime = JaDateTime.valueOf("20181111 000000");
        approFileInfo.setFiletime(jaDateTime);*/

        //approFileService.saveOneApproFileInfo(approFileInfo);

        //JaDateTime jaDateTime = JaDateTime.valueOf("20181120 000000");
        /*System.out.println(System.currentTimeMillis());
        JaDateTime jaDateTime = JaDateTime.valueOf(System.currentTimeMillis());
        System.out.println(jaDateTime.getYear());
        System.out.println(jaDateTime.getMonth());
        System.out.println(jaDateTime.getDay());
        System.out.println(jaDateTime.getHour());
        System.out.println(jaDateTime.getMinute());
        System.out.println(jaDateTime.getSecond());

        String timeStr = jaDateTime.getYearString() + jaDateTime.getMonthString() + jaDateTime.getDayString() + " "+jaDateTime.getHourString() +jaDateTime.getMinuteString() + jaDateTime.getSecondString();
        System.out.println(timeStr);
        jaDateTime = JaDateTime.valueOf(timeStr);

        System.out.println(jaDateTime.timestampValue().getTime());*/

        //approFileService.deleteOneApproFileInfo(22);

        /*System.out.println("-----------start-------------");

        approFileInfo.setBank("wuhang");

        approFileService.saveOneApproFileInfo(approFileInfo);
        System.out.println("-----------over---------------");*/

        /*jaDateTime = jaDateTime.setMillisecond((int) System.currentTimeMillis());
        approFileInfo.setFiletime(jaDateTime);

        approFileService.saveOneApproFileInfo(approFileInfo);*/
       /* List<ApproFileInfo> list = approFileDao.queryByState(0);
        System.out.println(list.size());
        System.out.println(list.get(0));*/

       /* approFileInfo.setFiletime(new Date(System.currentTimeMillis()));
        approFileService.saveOneApproFileInfo(approFileInfo);*/



        //queryUnFished测试
        /*List<ApproFileInfo> list = approFileDao.queryUnFinshed();
        System.out.println("OK"+"入库完毕");
        System.out.println(list.size());*/

    }

    public TestTask clones(){

        try {
            return (TestTask) clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
}
